<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>
        
        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">

            </ui:define>

            <ui:define name="left">

            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form><p:growl life="2000"/>
                        <h1><h:outputText value="Create/Edit Categories"/></h1>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Clave:" for="clave" />
                            <p:inputMask mask="99-999-999" id="clave" value="#{categoryBean.category.clave}" title="Clave" required="true" requiredMessage="The Clave field is required."/>
                            <h:outputLabel value="Descripcion:" for="descripcion" />
                            <p:inputText id="descripcion" value="#{categoryBean.category.descripcion}" title="Descripcion" required="true" requiredMessage="The Descripcion field is required.">
                                <f:validateRegex pattern="^[A-Za-z\s]+$"/>
                            </p:inputText>
                            <h:outputLabel value="Color:" for="color" />
                            <p:inputMask mask="9999" id="color" value="#{categoryBean.category.color}" title="Color" validatorMessage="El color debe ser un numero"/>
                            <p:commandButton action="CategoryConfirm" icon="ui-icon-check" value="Register" ajax="false"/>
                            <p:commandButton action="CategoryList" icon="ui-icon-cancel" value="Cancel" immediate="true" ajax="false"/>
                        </h:panelGrid>
                    </h:form>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
